
import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/frameWork";


// 查询案件列表
export function listCase(query) {
  return request({
    url: '/supervision/caseManagement/list',
    method: 'get',
    params: query
  })
}

// 查询案件详细
export function getCase(id) {
  return request({
    url: '/supervision/caseManagement/' + parseStrEmpty(id),
    method: 'get'
  })
}
// 新增案件
export function addCase(data) {
  return request({
    url: '/supervision/caseManagement/',
    method: 'post',
    data: data
  })
}
//删除案件
export function delCase(caseId) {
  return request({
    url: '/supervision/caseManagement/' + caseId,
    method: 'delete'
  })
}
// 修改案件
export function updateCase(data) {
  return request({
    url: '/supervision/caseManagement/',
    method: 'put',
    data: data
  })
}
// 查询树结构
export function getTree() {
  return request({
    url: '/supervision/xzqh/getXzqhTree/',
    method: 'get'
  })
}
//根据任务得到案件
export function getCaseByTask(id) {
  return request({
    url: '/supervision/caseManagement/getCaseByTask/'+parseStrEmpty(id),
    method: 'get'
  })
}
// 表单判决书号重复校验
export function validNumber(data) {
  return request({
    url: '/supervision/caseManagement/isCaseRepeated',
    method: 'post',
    data: data
  })
}
// 拿到下拉框的案件列表
export function getCaseList(data) {
  return request({
    url: '/supervision/caseManagement/getCaseList',
    method: 'post',
    data: data
  })
}
//根据任务得到案件
export function queryByFjbm(fjbm) {
  return request({
    url: '/supervision/tjczdxx/queryByFjbm?fjbm='+fjbm,
    method: 'get'
  })
}
// 批量导入
export function batchInsert(data) {
  return request({
    url: '/supervision/caseManagement/batchInsert',
    method: 'post',
    data: data
  })
}